package com.muyu.system.service.impl;

import com.muyu.system.domain.DanmoShoppingSubcategory;
import com.muyu.system.mapper.DanmoShoppingSubcategoryMapper;
import com.muyu.system.service.IDanmoShoppingSubcategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品子分类Service业务层处理
 *
 * @author yangle
 * @date 2024-09-26
 */
@Service
public class DanmoShoppingSubcategoryServiceImpl implements IDanmoShoppingSubcategoryService
{
    @Autowired
    private DanmoShoppingSubcategoryMapper danmoShoppingSubcategoryMapper;

    /**
     * 查询商品子分类
     *
     * @param id 商品子分类主键
     * @return 商品子分类
     */
    @Override
    public DanmoShoppingSubcategory selectDanmoShoppingSubcategoryById(Long id)
    {
        return danmoShoppingSubcategoryMapper.selectDanmoShoppingSubcategoryById(id);
    }

    /**
     * 查询商品子分类列表
     *
     * @param danmoShoppingSubcategory 商品子分类
     * @return 商品子分类
     */
    @Override
    public List<DanmoShoppingSubcategory> selectDanmoShoppingSubcategoryList(DanmoShoppingSubcategory danmoShoppingSubcategory)
    {
        return danmoShoppingSubcategoryMapper.selectDanmoShoppingSubcategoryList(danmoShoppingSubcategory);
    }

    /**
     * 新增商品子分类
     *
     * @param danmoShoppingSubcategory 商品子分类
     * @return 结果
     */
    @Override
    public int insertDanmoShoppingSubcategory(DanmoShoppingSubcategory danmoShoppingSubcategory)
    {
        return danmoShoppingSubcategoryMapper.insertDanmoShoppingSubcategory(danmoShoppingSubcategory);
    }

    /**
     * 修改商品子分类
     *
     * @param danmoShoppingSubcategory 商品子分类
     * @return 结果
     */
    @Override
    public int updateDanmoShoppingSubcategory(DanmoShoppingSubcategory danmoShoppingSubcategory)
    {
        return danmoShoppingSubcategoryMapper.updateDanmoShoppingSubcategory(danmoShoppingSubcategory);
    }

    /**
     * 批量删除商品子分类
     *
     * @param ids 需要删除的商品子分类主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingSubcategoryByIds(Long[] ids)
    {
        return danmoShoppingSubcategoryMapper.deleteDanmoShoppingSubcategoryByIds(ids);
    }

    /**
     * 删除商品子分类信息
     *
     * @param id 商品子分类主键
     * @return 结果
     */
    @Override
    public int deleteDanmoShoppingSubcategoryById(Long id)
    {
        return danmoShoppingSubcategoryMapper.deleteDanmoShoppingSubcategoryById(id);
    }
}
